<template>
	<el-form ref="formObj" :model="props.formData" :rules="rules" label-width="80px">
		<!-- 
	
		bloodType: '',
		familyMember: '' -->
		
		<el-form-item label="客户姓名" prop="name">
			<el-input v-model="props.formData.name" placeholder="请输入客户姓名" />
		</el-form-item>
		<el-form-item label="身份证号" prop="idcard">
			<el-input v-model="props.formData.idcard" placeholder="请输入身份证号" />
		</el-form-item>
		<el-form-item label="房间号" prop="roomNo">
			<el-select-v2
				value-key="id"
				filterable
				v-model="props.formData.roomNo"
				placeholder="请选择房间号"
				:options="props.roomList"
				:props="roomapi.roomProps"
				@change="props.getBedList"></el-select-v2>
		</el-form-item>
		<el-form-item label="入住日期" prop="checkinDate">
			<el-date-picker
				v-model="props.formData.checkinDate"
				placeholder="请输入入住日期"
				type="date"
				value-format="YYYY-MM-DD"/>
		</el-form-item>
		<el-form-item label="退住日期" prop="expirationDate">
			<el-date-picker
				v-model="props.formData.expirationDate"
				placeholder="请输入退住日期"
				type="date"
				value-format="YYYY-MM-DD"/>
		</el-form-item>
		<el-form-item label="联系电话" prop="contactTel">
			<el-input v-model="props.formData.contactTel" placeholder="请输入联系电话" />
		</el-form-item>
		<el-form-item label="床位" prop="bedId">
			<el-select-v2
				filterable
				v-model="props.formData.bedId"
				placeholder="请选择床位"
				:options="props.bedList"
				:props="bedapi.bedProps"></el-select-v2>
		</el-form-item>
		<el-form-item label="身心状态" prop="psychosomaticState">
			<el-input type="textarea" :rows="3" v-model="props.formData.psychosomaticState" placeholder="请输入身心状态描述" />
		</el-form-item>
		<el-form-item label="注意事项" prop="attention">
			<el-input type="textarea" :rows="3" v-model="props.formData.attention" placeholder="请输入注意事项" />
		</el-form-item>
		<el-form-item label="身高" prop="height">
			<el-input v-model="props.formData.height" placeholder="请输入身高" />
		</el-form-item>
		<el-form-item label="体重" prop="weight">
			<el-input v-model="props.formData.weight" placeholder="请输入体重" />
		</el-form-item>
		<el-form-item label="血型" prop="bloodType">
			<el-select-v2
				filterable
				v-model="props.formData.bloodType"
				placeholder="请选择血型"
				:options="props.bloodTypeList"
				:props="bloodTypeProps"></el-select-v2>
		</el-form-item>
		<el-form-item label="家庭成员" prop="familyMember">
			<el-input v-model="props.formData.familyMember" placeholder="请输入家庭成员" />
		</el-form-item>
		<el-form-item>
			<el-button type="primary" @click="props.save">保存</el-button>
		</el-form-item>
		
	</el-form>
</template>

<script setup>
import { ref } from 'vue'
import roomapi from '@/api/roomapi'
import bedapi from '@/api/bedapi'
const props = defineProps(['formData', 'rules', 'roomList', 'bedList','save', 'getBedList' , 'bloodTypeList'])


const bloodTypeProps = {
	value: 'text',
	label: 'text'
}
const formObj = ref()
defineExpose({
	formObj
})
</script>

<style scoped lang="scss">
.el-form {
	::v-deep .el-input {
		width: 100%;
	}
}

</style>